from time import sleep
from multiprocessing import Process
import os


def func01():
    sleep(4)
    print("eat")
    print(os.getppid(), "---", os.getpid())


def func02():
    sleep(3)
    print("sleep")
    print(os.getppid(), "---", os.getpid())


def func03():
    sleep(5)
    print("drink")
    print(os.getppid(), "---", os.getpid())


print("function start")
jobs = []
for func in [func01, func02, func03]:
    p = Process(target=func)
    jobs.append(p)
    p.start()

for i in jobs:
    i.join()
print("all is over")
